<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateArticlesTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('articles', function(Blueprint $table)
		{
			$table->increments('id');
			$table->char('object_id', 36)->unique('object_id_unique')->comment('objectId');
			$table->string('alias', 150)->nullable()->comment('别名');
			$table->string('title', 150)->comment('文章标题');
			$table->string('subtitle', 150)->nullable()->comment('副标题');
			$table->string('keywords', 150)->nullable()->comment('关键字');
			$table->string('description')->nullable()->comment('文章描述');
			$table->string('author', 60)->nullable()->comment('文章作者');
			$table->string('source', 50)->nullable()->comment('文章来源');
			$table->text('content', 65535)->comment('文章内容');
			$table->string('thumb')->nullable()->comment('封面');
			$table->string('is_link')->default('0')->comment('isLink');
			$table->string('link')->nullable()->comment('Link');
			$table->string('type', 30)->comment('类型');
			$table->integer('reply_count')->unsigned()->default(0)->comment('回复量');
			$table->integer('views')->unsigned()->default(0)->index('views_index')->comment('浏览数');
			$table->integer('order')->default(0)->index('order_index')->comment('排序');
			$table->integer('weight')->default(0)->comment('权重');
			$table->string('template')->nullable()->comment('模板');
			$table->text('css', 65535)->nullable()->comment('style');
			$table->text('js', 65535)->nullable()->comment('javascript');
			$table->string('top')->default('0')->comment('置顶');
			$table->string('status')->default('1')->comment('状态');
			$table->integer('created_op')->default(0)->comment('创建人');
			$table->integer('updated_op')->default(0)->comment('更新人');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('articles');
	}

}
